package com.ccbooks.listener;

import com.ccbooks.view.BookContentView;
import com.ccbooks.view.BookContentView1;
import com.ccbooks.view.R;
import com.ccbooks.vo.Book;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

public class OpenBookListerer implements OnClickListener {

	private Context context;
	private int id;
	
	public OpenBookListerer(Context context,int id) {
		this.id=id;
		this.context=context;
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		v.setBackgroundDrawable(context.getResources()
				.getDrawable(R.drawable.btn_ppressed_color));
		Intent intent = new Intent();
		Bundle bundle = new Bundle();
		bundle.putInt("bookId", id);
		intent.putExtras(bundle);
		intent.setClass(context, BookContentView.class);
		context.startActivity(intent);
	}

}
